﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MX.Core.Http.WebAction
{
    /// <summary>
    /// 表单信息基类
    /// 表单信息类型的实现都需继承此类
    /// </summary>
    abstract public class PostInfo : IPostInfo
    {
        public PostInfo(PostContentType contentType, string formEncoding)
        {
            ContentType = contentType;
            FormEncoding = formEncoding;
        }
        /// <summary>
        /// 表单ContentType
        /// </summary>
        public PostContentType ContentType { get; set; }

        /// <summary>
        /// 表单编码
        /// </summary>
        public string FormEncoding { get; set; }


        #region IPostInfo 成员

        abstract public byte[] GetPostData();
   
         

        /// <summary>
        /// 获取ContentType的文本描述
        /// </summary>
        /// <returns></returns>
        public string GetContentType()
        {
            return ContentType.ContentType;
        }

        abstract public string GetPostString();
         
        #endregion
    }
}
